Clipping paths are used by many image/vector editing applications to cut out objects from input objects (e.g., images, vectors, Bezier paths, gradients, patterns, etc.). When a clipping path is applied to an input object, any portion of the input object within the clipping path is included while any portion of the input object outside the clipping path is excluded (or vice versa). For instance, clipping paths can be used on an image of a product to remove the background surrounding the product and thereby provide an image of the product by itself.
Clipping paths can result in aliased renderings in which clipped objects have jagged edges. To address this issue, anti-aliasing is often used to smooth out the appearance of edges from clipping paths. Traditional GPU-based techniques used for anti-aliasing rely on multisample anti-aliasing (MSAA). MSAA uses a multisampled color buffer in conjunction with a multisampled stencil buffer to achieve the desired clipping effect. However, this approach has memory and performance implications making the technique inefficient in rendering complicated artwork. In particular, MSAA is dependent upon multisampling, which means that every pixel is treated as “N” subpixels (“N” being the multisampling factor). This effectively increases the storage requirement for the entire screen (and any associated textures/buffers like stencil and depth buffers) by “N” times. The pixels to be processed may also grow “N” times, which drastically decreases rendering performance. The problem is further complicated when an input object includes multiple clipping paths that must be processed. In some instances, the memory and performance issues from MSAA prevent some complicated artworks from being rendered (especially when the underlying color space is CMYK or N-Channel, which inherently need more memory than RGB).